using System;

namespace Kiwi.Container
{
    public class IllegalComponentCastException : ContainerException
    {
        public IllegalComponentCastException(Type fromType, Type toType)
        {
            FromType = fromType;
            ToType = toType;
        }

        public Type FromType { get; set; }
        public Type ToType { get; set; }

        public override string Message
        {
            get { return string.Format("Component registration of type {0} cannot be cast to type {1}.", FromType, ToType); }
        }
    }
}